# -*- python -*-
# Copyright (c) 2012 The Native Client Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

Import('env')


mandel_tiled_nexe_name = env.ProgramNameForNmf('mandel_tiled')
mandel_tiled_nexe = env.ComponentProgram(mandel_tiled_nexe_name,
                                         'mandel_tiled.c',
                                         EXTRA_LIBS=[
                                             'srpc',
                                             'platform',
                                             'gio',
                                             'imc',
                                             'imc_syscalls',
                                             '${PTHREAD_LIBS}',
                                             '${NONIRT_LIBS}'])

env.Publish(mandel_tiled_nexe_name, 'run', ['mandel_tiled.html',
                                            'mandel_tiled.nmf'])


mandel_nexe_name = env.ProgramNameForNmf('mandel')
mandel_nexe = env.ComponentProgram(mandel_nexe_name, 'mandel.c',
                                   EXTRA_LIBS=[
                                       'srpc',
                                       'platform',
                                       'gio',
                                       'imc',
                                       'imc_syscalls',
                                       '${PTHREAD_LIBS}',
                                       '${NONIRT_LIBS}'])

env.Publish(mandel_nexe_name, 'run', [])

node = env.SelUniversalTest('mandel_test.out',
                            mandel_nexe,
                            stdin=env.File('test.stdin'),
                            stdout_golden=env.File('test.stdout'))
env.AddNodeToTestSuite(node,
                       ['small_tests', 'sel_ldr_tests'],
                       'run_mandel_test')
